bopen [options]

options:
	--bookmarks -- list bookmarks (default)
	--history   -- list history (default when started as `hopen')
	--tabs      -- list tabs (default when started as `topen')
	--stdout    -- dump URIs to stdout
	--dump
	[!]--no-run -- only open URL if browser already running (to prevent accidentally hogging the host)
	[!]--ask    -- if browser is not running, ask user to start it
	--config <path>
	[!]--browser <path> -- specify browser to use
	[!]--browser-args <???>
	[!]--menu <path> -- specify menu program to use
	[!]--menu-args <???>

	Options marked with [!] are possibly too specific to be implemented.

	bopen should be split into two scripts, similarly to dmenu_run and dmenu_path. One script dumps the list of URIs to stdout, the other script pipes the list from stdin | $menu | filter | $browser

configuration file
	Default path: ~/.config/bopen.conf

configuration variables
	The configuration file is actually a shell include; bopen simply sources the file. That means, the variables that bopen uses can be directly overridden, possibly in creative ways.

environment variables
	BROWSER
	(is MENU a thing?)

How browser is selected, sorted by descending priority:
	BROWSER (env var) (replaces --browser and browser=)
	[!]--browser
	[!]browser= (var in config file)
	xdg-open
	static, hardcoded fallback:
		firefox
		icecat
		chromium
		…


NOTES
	--tabs is supposed to work the same as going to a tab through the URL bar, but the current behaviour of firefox/icecat via CLI doesn't allow this. When opening a URL from CLI, the browser always opens a new tab, as if --new-tab was given. So --tabs is unlikely to be useful, though /that/ would actually be the most useful feature to me, as firefox is slow as fuck for me in the URL bar, and especially in the tab menu. But at the very least, tabs can be extracted to save them from session loss.


[
	In firefox, bookmarks and history are saved in places.sqlite. But that db can't be used while firefox is running, because it is locked. One could copy that file to somewhere else, but that's probably much overhead. And even then, I think history isn't written there immediately, but I haven't verified properly. So that's not really useful then.

	The rest of history seems to be written to sessionstore-backups/*.jsonlz4, mixed along with tabs.

	https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data
	https://github.com/andikleen/lz4json/blob/master/lz4jsoncat.c
	https://github.com/pellucida/jsonlz4_json/tree/master/src
	https://github.com/Aethlas/fflz4

	https://github.com/balta2ar/brotab
]
